<% import grails.persistence.Event %>
<%=packageName%>
<g:if test="\${flash.message}">
            <div class="message">\${flash.message}</div>
            </g:if>
            <g:hasErrors bean="\${${propertyName}}">
            <div class="errors">
                <g:renderErrors bean="\${${propertyName}}" as="list" />
            </div>
            </g:hasErrors>

            <g:formRemote method="post" name="form_edit_\${${propertyName}.id}" url="\${[action:'save']}" update="div_insert" after="closeInsertifNoError('div_insert')">

                
                <div >
                    <table>
                        <tbody>
                        <%  excludedProps = Event.allEvents.toList() << 'version' << 'id'
                            props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
                            Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
                            props.each { p ->
                                if(!inlines || !inlines.find{item -> item.equals(p.name)}) {
                                  cp = domainClass.constrainedProperties[p.name]
                                  display = (cp ? cp.display : true)
                                  if (display) { %>
                              <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="${p.name}"><g:message code="${domainClass.propertyName}.${p.name}.label" default="${p.naturalName}" /></label>
                                </td>
                                <td valign="top" class="value \${hasErrors(bean: ${propertyName}, field: '${p.name}', 'errors')}">
                                    ${renderEditor(p)}
                                </td>
                            </tr>
                        <%  } }  } %>
                        </tbody>
                    </table>
                </div>
                <div >

                    <input type="submit"   class="jqButtonSave"  value="\${message(code: 'default.button.update.label', default: 'Update')}" />
                </div>
            </g:formRemote>
<script type="text/javascript">
  \$(".datepicker").datepicker({dateFormat: 'dd/mm/yy'});
</script>